package com.peace.hospital.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.peace.hospital.entity.hospitalization.entity.People;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xie
 * @since 2019-11-05
 */
@Mapper
public interface PeopleMapper extends BaseMapper<People> {

    @Insert({
            "INSERT INTO hospital_public.people(pname,pcode,pgender)" +
                    "VALUES( #{pname}, #{pcode}, #{pgender})"
    })
    boolean insertPeople(People people);

    @Select("SELECT * FROM hospital_public.people WHERE pcode = #{pcode} limit 1")
    People selectPeopleByCode(People p);



}
